﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace AllyTrainer.AJAX
{
    public partial class SendPassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BAL.conn.connectionString = ConfigurationManager.ConnectionStrings["CTEA"].ConnectionString;
            if (Request.QueryString["username"] != null && Request.QueryString["type"] != null)
            {

                string username = Request.QueryString["username"].ToString();
                int type = Convert.ToInt32(Request.QueryString["type"]);
                int res = BAL.Customers.OnForgotPassword(username, type);

                if (res == 1)
                {
                    Response.Write("Your password has been sent to your Registered Email ID : ");
                }
                else
                {
                    Response.Write("Sorry !! Your UserName does not exist.");

                }
            }
            else
            {
                Response.Write("Please Enter Your Valid Data.");
            }
            Response.End();
        }
    }
}